package com.yf.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class SDCardStateReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		Log.v("Broadcast", "sd卡被操作了");
		
		String action = intent.getAction();
		if ("android.intent.action.MEDIA_MOUNTED".equals(action)) {
			Log.v("Broadcast", "sd已挂载");
		} else if ("android.intent.action.MEDIA_UNMOUNTED".equals(action)) {
			Log.v("Broadcast", "sd卸载了");
		}
	}

}
